#define _CRT_SECURE_NO_WARNINGS

#include<iostream>
#include"myunordered_map.hpp"
#include"myunordered_set.hpp"

using namespace std;

void test01()
{
	myunordered_set::unordered_set<int> m;

	vector<int> v = { 1,1,1,1,3,3,4,7,4,3,6,1,111111,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 };
	int i = 0;
	for (auto e : v)
	{
		m.insert(e);
	}
	myunordered_set::unordered_set<int> m2 = m;
	for (auto e : v)
	{
		//cout << m2.count(e) << endl;
	}
	myunordered_set::unordered_set<int>::iterator it = m2.end();
	cout << endl << endl << endl;
	while (it != m2.begin())
	{
		it--;
		cout << *it<< endl;
	}
}

int main()
{
	myunordered_map::unordered_map<int, int> m;
	
	vector<int> v = {123,345,22,2,23,623,6,3426,8,34,23,6,3,3,6,23,999,34555,89888,2222,5555,22222223,223,234,23455,232343,234};
	int i = 0;
	for (auto e : v)
	{
		m[e]++;
	}
	myunordered_map::unordered_map<int, int> m2=m;
	//for (auto e : v)
	//{
	//	//cout << m2.find(e)->first << ":" << m2.find(e)->second << endl;
	//	//cout << m2.count(e) << endl;
	//}
	myunordered_map::unordered_map<int, int>::iterator it = m2.end();
	cout << endl << endl << endl;
	while (it != m2.begin())
	{
		it--;
		cout << it->first << ":" << it->second << endl;
	}

	//test01();
	return 0;
}